void waypt_flush_all(void);
unsigned int waypt_count(void);
void free_gpx_extras (xml_tag * tag);
+void xcsv_setup_internal_style(const char *style_buf);
void xcsv_read_internal_style(const char *style_buf);
waypoint * find_waypt_by_name(const char *name);
char *prefer_shortnames = NULL;
char *xcsv_urlbase = NULL;
+static const char *intstylebuf = NULL;
+
static
arglist_t xcsv_args[] = {
{"style", &styleopt, "Full path to XCSV style file", NULL,
queue *elem, *tmp;
field_map_t *fmp;
ogue_t *ogp;
+ int internal = 0;
/*
* If this xcsv_file struct came from a file we can free it all.
xfree(xcsv_file.mkshort_handle);
/* return everything to zeros */
+ internal = xcsv_file.is_internal;
memset(&xcsv_file, '\0', sizeof(xcsv_file));
+ xcsv_file.is_internal = internal;
}
static const char *
}
}
+void
+xcsv_setup_internal_style(const char *style_buf)
+{
+ xcsv_file_init();
+ xcsv_file.is_internal = !!style_buf;
+ intstylebuf = style_buf;
+}
+
+
static void
xcsv_rd_init(const char *fname)
{
* if we don't have an internal style defined, we need to
* read it from a user-supplied style file, or die trying.
*/
- if (xcsv_file.is_internal == 0) {
+ if (xcsv_file.is_internal ) {
+ xcsv_read_internal_style( intstylebuf );
+ }
+ else {
if (!styleopt)
fatal(MYNAME ": XCSV input style not declared. Use ... -i xcsv,style=path/to/file.style\n");
/* if we don't have an internal style defined, we need to
* read it from a user-supplied style file, or die trying.
*/
- if (xcsv_file.is_internal == 0) {
+ if (xcsv_file.is_internal ) {
+ xcsv_read_internal_style( intstylebuf );
+ }
+ else {
if (!styleopt)
fatal(MYNAME ": XCSV output style not declared. Use ... -o xcsv,style=path/to/file.style\n");